<?php
	require_once '../../controller/candidatos/' . basename(__FILE__);
	$pagina[0] = array('Candidatos');
    require_once '../../template/header.php';
?>
<div id="conteudo">
	<?php TMensagens::exibirStatus($erro, $sucesso) ?>
    <form method="post" action="<?php echo basename(__FILE__);?>" >
<?php   $criteria = array();

        $terceirizadoids = $usuario->getTerceirizadosFilterSQL();
        $candidatoids = $usuario->getCandidatosFilterSQL();

        $criteria['precondicao'] = '';
        if ($terceirizadoids) {
            $criteria['precondicao'] .= 'candidato.candidatoid IN (' . $terceirizadoids . ')';
            $criteria['precondicao'] .= 'OR candidato.candidatoid IN (' . $candidatoids . ')';
        }
        
        $criteria['orderBy'] = 'nome';
        
        $d = new TDataTable(
            new Candidato(),
            'candidatoid',
            $criteria,
            array('checkColumn'=>FALSE, 'itensPerPage' => 30));
            
        $d->addColumnsData(array('nome','cpf','contato' ));
        print $d->render(); ?>
    </form>
</div>
<?php require_once '../../template/footer.php'; ?>